<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateSuperviseSheetReplyTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('supervise_sheet_reply', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('supervise_id',false)->default(0)->comment('监督问卷id');
            $table->unsignedBigInteger('sheet_id',false)->default(0)->comment('监督项id');
            $table->text('reply_txt')->nullable()->comment('回复内容');
            $table->text('reply_images')->nullable()->comment('回复图片');
            $table->unsignedBigInteger('userable_id')->default(0)->comment('用户id');
            $table->string('userable_type',60)->comment('用户类型');
            $table->unsignedBigInteger('unit_id',false)->default(0)->comment('单位id');
            $table->string('unit_name')->nullable()->comment('单位名称');
            $table->timestamps();
            $table->softDeletes();
            $table->engine = 'Innodb';
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('supervise_sheet_reply');
    }
}
